import request from '@/utils/request'

/**
 * 获取部门列表
 * @return
 */
export function getDepartments(){
    return request({
        url: 'company/department'
    })
}

// 新增接口
export function addDepartments(data){
    return request({
        url:'company/department',
        method:'post',
        data
    })
}

// 获取部门详情数据
export function getDepartmentsDetail(id){
    return request({
        url:`company/department/${id}`,
        
    })
}

// 编辑部门
export function updateDepartment(data){
    return request({
        url:`company/department/${data.id}`,
        method:'put',
        data
    })
}

// 删除部门
export function delDepartment(id){
    return request({
        url: `company/department/${id}`,
        method: 'delete'
      })
}